from rest_framework.views import APIView

class NewView(APIView):
    def check_permissions(self, request):
        for per in self.get_permissions():
            if per.has_permission(request, self):
                return
            else:
                self.permission_denied(request, message=getattr(per, 'message', None),
                                       code=getattr(per, 'code', None))
